package ch01;

public class Main {
    public static YunSuan createOperation(String operator) {
        if (operator.equals("+")) {
            return new He();
        } else if (operator.equals("-")) {
            return new Jian();
        } else {
            throw new IllegalArgumentException("Invalid operator");
        }
    }
}
